<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">
        var arr = ["a", "b", "c", "d", "e", "f"];
        var result1 = arr.slice(2);
        var result2 = arr.slice(-2);
        var result3 = arr.slice(2, 4);
        var result4 = arr.slice(4, 2);
        console.log("arr:" + JSON.stringify(arr));
        console.log("result1:" + JSON.stringify(result1));
        console.log("result2:" + JSON.stringify(result2));
        console.log("result3:" + JSON.stringify(result3));
        console.log("result4:" + JSON.stringify(result4));
    </script>
</body>

</html>